<script language="javascript" type="text/javascript">
	
        function submit_item() {
            try {
                    parent.parent.set_element(false);
                    var quotations = jQuery(".quotation");
                    jQuery.each(quotations, function(){
                        if(this.checked){
                            parent.parent._obj_fSendValue(this.id, jQuery(this).val(), "list_quotation_id", "list_quotation_number");
                            parent.parent.init_item(this.id);
                            
                            var diskon = jQuery("#diskon_"+this.id).val();
                            parent.parent.append_diskon(diskon ? diskon : 0);
                        }
                    });
                    parent.parent.set_element(true);
            }
            catch(e) { alert(e.message); }
            parent.parent.focus();
            
            close_gb();
        }
        
        function close_gb(){
            <?php echo CloseGB(false); // close greybox   ?>
        }
</script>

<h3 class="title-popup">Daftar Quotation</h3>

<div style="padding: 10px;">
<div class="DivTable">

    <form name="fCari" id="fCari" action="" method="get" >
            <table class="GridTableFilter">
                <tr>
                    <td>
                        <?php
                        echo $fp;
                        ?>
                    </td>
                </tr>
            </table>
        </form>
        <br class="bersih" />
        
<table class="GridTable" style="width:100%;">

<tr class="GridHeader">
<td>No.</td>
<td>Nomor Quotation</td>
</tr>
<?php

if ($numRows > 0) {
        $nomor = 0;
        foreach ($result as $row) {
            $nomor++;
        ?>
        <tr class="GridItem1">
        <td><?php echo  $nomor;?>&nbsp;<input type="checkbox" id="<?php echo  $row->id_quotation;?>" value="<?php echo $row->nomor_quotation;?>" class="quotation" /></td>
        <td>
            <?php echo  $row->nomor_quotation;?>
            <input type="hidden" name="vNama" value="<?php echo str_replace("'", "\'", $row->nomor_quotation); ?>" />
            <input type="hidden" id="diskon_<?php echo  $row->id_quotation;?>" value="<?php echo $row->diskon; ?>" />
        </td>
        </tr>
<?php
    }

}
else {
?>
	<tr class="GridItem1">
		<td colspan="6">Tidak ada data</td>
	</tr>

<?php
}
?>
</table>
</div>

<br class="bersih" />

<div style="left: 0; bottom: 0; width: 100%; background: black; padding: 3px;">
    <button onclick="submit_item();">Save</button>&nbsp;
    <button onclick="close_gb();">Cancel</button>
</div>
</div>